/* GUI CONVERTED from rcschdel.p (converter v1.75) Sat Aug 12 23:01:21 2000 */
/* rcschdel.p - Release Management Customer Schedules                   */
/* Copyright 1986-2002 QAD Inc., Carpinteria, CA, USA.                  */
/* All rights reserved worldwide.  This is an unpublished work.         */
/*F0PN*/ /*V8:ConvertMode=Maintenance                                   */
/*K1Q4*/ /*V8:WebEnabled=No                                             */
/* REVISION: 7.0    LAST MODIFIED: 01/29/92           BY: WUG *F110*    */
/* REVISION: 7.3    LAST MODIFIED: 08/13/93           BY: WUG *GE19*    */
/* REVISION: 7.3    LAST MODIFIED: 11/02/93           BY: WUG *GG87*    */
/* REVISION: 7.3    LAST MODIFIED: 04/11/95           BY: ame *F0QB*    */
/* REVISION: 8.6    LAST MODIFIED: 05/20/98           BY: *K1Q4* Alfred Tan */
/* REVISION: 9.1    LAST MODIFIED: 08/12/00           BY: *N0KP* myb        */


          /* SCHEDULE DELETE */
/*F0QB*/  {mfdeclre.i}

          define input parameter sch_recid as recid.
          define input parameter detail_only like mfc_logical.

/*F0QB*   {mfdeclre.i}*/

          define variable old_db as character.
/*F0QB*/  define variable sdb_err as integer no-undo.

          find sch_mstr where recid(sch_mstr) = sch_recid exclusive-lock.

          /*GG87 MAKE IT WORK FOR ALL TYPES OF SCHEDULES*/

          if sch_type <= 3 then do:
             find sod_det where sod_nbr = sch_nbr and sod_line = sch_line no-lock.
             find si_mstr where si_site = sod_site no-lock.
          end.
          else do:
             find pod_det where pod_nbr = sch_nbr and pod_line = sch_line no-lock.
             find si_mstr where si_site = pod_site no-lock.
          end.

          if si_db <> global_db then do:
             old_db = global_db.
/*F0QB*      create alias qaddb for database value(si_db).*/
/*F0QB*      global_db = si_db.*/
/*F0QB*/     {gprun.i ""gpalias3.p"" "(input si_db, output sdb_err)"}
/*GUI*/ if global-beam-me-up then undo, leave.


             {gprun.i ""rcschdla.p""
             "(input sch_type, input sch_nbr, input sch_line, input sch_rlse_id,
             input detail_only)"}
/*GUI*/ if global-beam-me-up then undo, leave.


/*F0QB*      create alias qaddb for database value(old_db).*/
/*F0QB*      global_db = old_db.*/
/*F0QB*/     {gprun.i ""gpalias3.p"" "(input old_db, output sdb_err)"}
/*GUI*/ if global-beam-me-up then undo, leave.

          end.

          {gprun.i ""rcschdla.p""
          "(input sch_type, input sch_nbr, input sch_line, input sch_rlse_id,
          input detail_only)"}
/*GUI*/ if global-beam-me-up then undo, leave.

